package com.quick.proxy.client.handler.real;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;

import java.util.List;


/**
 * Description: 接收数据时解码
 * Author: 吃素不吃肉
 * Date: 2023/7/9
 *
 * @author 吃素不吃肉
 */
public class RealProxyProtocolDecoder extends ByteToMessageDecoder {
    @Override
    protected void decode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, List<Object> list) {
        byte[] decodeBytes = new byte[byteBuf.readableBytes()];
        byteBuf.readBytes(decodeBytes);
        list.add(decodeBytes);
    }
}
